package vip.xiaonuo.smzq.modular.lifecycle.service.entity.impl;

import  java.util.List;
import java.util.Map;
import cn.hutool.core.lang.tree.TreeNode;
import cn.hutool.core.lang.tree.TreeUtil;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.map.MapUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.stereotype.Service;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import org.springframework.beans.factory.annotation.Autowired;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import vip.xiaonuo.smzq.modular.lifecycle.entity.LifeCycleMineStore;
import vip.xiaonuo.smzq.modular.lifecycle.mapper.entity.LifeCycleMineStoreMapper;
import vip.xiaonuo.smzq.modular.lifecycle.service.entity.LifeCycleMineStoreService;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 于彦飞
 * @since 2024-03-21
 */
@Service
public class LifeCycleMineStoreServiceImpl extends ServiceImpl<LifeCycleMineStoreMapper, LifeCycleMineStore> implements LifeCycleMineStoreService {
        @Autowired
        private LifeCycleMineStoreMapper lifeCycleMineStoreMapper;



        @Override
        public List<LifeCycleMineStore>  queryLifeCycleMineStoreList(LifeCycleMineStore lifeCycleMineStore){
            List<LifeCycleMineStore> list = new LambdaQueryChainWrapper<LifeCycleMineStore>(lifeCycleMineStoreMapper).setEntity(lifeCycleMineStore)
            .orderByAsc(LifeCycleMineStore::getStoreDate).list();
//            DictConvertUtil.convertToDictionaryList(list,null);
            return list;
        }

        @Override
        public IPage<LifeCycleMineStore> queryLifeCycleMineStoreListPage(LifeCycleMineStore lifeCycleMineStore){
            IPage<LifeCycleMineStore> iPage = new LambdaQueryChainWrapper<LifeCycleMineStore>(lifeCycleMineStoreMapper).setEntity(lifeCycleMineStore)
            .page(new Page<>(1,10));

            List<LifeCycleMineStore> records = iPage.getRecords();
//            DictConvertUtil.convertToDictionaryList(records,null);
            iPage.setRecords(records);
            return iPage;
        }


    @Override
    public boolean delLifeCycleMineStore(String id){
        return this.removeById(id);
    }
    @Override
    public boolean delLifeCycleMineStoreBatch(List<String> ids){
        return this.removeByIds(ids);
    }

}

